<template>
  <div class="flex-col-center">
    <el-upload
        ref="uploadRef"
        drag
        :on-exceed="handleExceed"
        :action="action"
        v-bind="$attrs"
    >
      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
      <div class="el-upload__text">
        拖拽图片 或<em>点击上传</em>
      </div>
      <template #tip>
        <div class="el-upload__tip">
          [ jpg 或 png ] (小于 2MB)
        </div>
      </template>
    </el-upload>
    <el-button @click="submit" style="width: 200px" :size="'large'" color="#222A42" :icon="UploadFilled">上传</el-button>
  </div>
</template>

<script lang="ts" setup>


import {ref,defineEmits,defineProps} from "vue";
import {UploadFilled} from "@element-plus/icons";
import {UploadFiles} from "element-plus";

let action=ref("")
let uploadRef=ref()
let props=defineProps<{

}>()

function submit(){

  uploadRef.value.submit()
}

function handleExceed(files:UploadFiles){

    // uploadRef.value!.clearFiles()
    // const file = files[0]
    // file.uid = new Date().getTime()
    // uploadRef.value!.handleStart(file)


}
</script>

<style scoped lang="less">

</style>